#include <STC89C5xRC.H>
#include "LCD1602.H"
#include "onewire.h"
#include "ds18b20.h"
#include "delay.h"


float T;


void main()
{
	ds18b20_convertT();
	Delayms(1000);
	LCD_Init();
	LCD_ShowString(1,1,"temperature:");
	
	while(1)
	{		
		ds18b20_convertT();
		T=ds18b20_readT();
		if(T<0)
		{
			LCD_ShowChar(2,1,'-');
			T=-T;
		}
		else
		{
			LCD_ShowChar(2,1,'+');
		}
		LCD_ShowNum(2,2,T,3);
		LCD_ShowChar(2,5,'.');
		LCD_ShowNum(2,6,((unsigned long)(T*10000))%10000,4);

	}

}